package com.itheima.d04_io_buffer_byte;

import java.io.*;

public class Test {
    public static void main(String[] args) throws IOException {
        long start = System.currentTimeMillis();
        FileInputStream fis = new FileInputStream("D:\\游戏\\ikun合集\\project\\1.jpg");
        FileOutputStream fos = new FileOutputStream("D:\\游戏\\ikun合集\\587119.jpg");
        BufferedInputStream bis = new BufferedInputStream(fis);
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        //创建缓冲流包装原始流
        byte[] bytes = new byte[1024];
        int len = -1;
        while ((len = bis.read(bytes)) != -1) {
            bos.write(bytes, 0, len);
            bos.flush();
        }
        fos.close();
        fis.close();
        System.out.println("复制完毕！");
        long end = System.currentTimeMillis();
        System.out.println("复制完毕！耗时：" + (end - start));

    }
}
